package com.lh.service.impl;

import com.lh.dao.CartDao;
import com.lh.entity.Cart;
import com.lh.entity.OrdersCart;
import com.lh.service.CartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @Author: LuoHang
 * @Date: 2021/2/15 17:13
 * @Description
 */
@Service
public class CartServiceImpl implements CartService{
    @Autowired
    private CartDao cartDao;

    @Override
    public List<Cart> getCarts(Integer userId) {
        return cartDao.getCarts(userId);
    }

    @Override
    public int addCart(Map<String, Object> map) {
        return cartDao.addCart(map);
    }

    @Override
    public int deleteCartById(Integer id) {
        return cartDao.deleteCartById(id);
    }

    @Override
    public int updateCart(Map<String, Object> map) {
        return cartDao.updateCart(map);
    }

    @Override
    public Cart getCartByUserIdGoodsId(Map<String, Object> map) {
        return cartDao.getCartByUserIdGoodsId(map);
    }

    @Override
    public int addOrdersCart(OrdersCart ordersCart) {
        return cartDao.addOrdersCart(ordersCart);
    }

    @Override
    public int getCartNums(Map<String, Integer> map) {
        return cartDao.getCartNums(map);
    }

    @Override
    public Cart getCartById(Integer id) {
        return cartDao.getCartById(id);
    }
}
